package protocol

import (
	"io"
)

type Packet interface {
	Key() uint16
	Id() uint64
	Event() string
	Body() []byte
	NewReplyPacket(data []byte) Packet
}

type Protocol interface {
	NewPacket(key MessageKey, id uint64, event string, data []byte) Packet
	WritePacket(p Packet, w io.Writer) (int, error)
	ReadPacket(r io.Reader) (Packet, error)
}
